<?php
class PresentationWYSIWYG extends Presentation {
    public function formatFormField(&$field) {
        parent::formatFormField($field);
        $field['type'] = 'textarea';
        $field['cols'] = '80';
        $field['rows'] = '8';
    }
    
    public function initFormDisplay() {
        $wysiwyg = Modules::getModule('TinyMCE');
        if ($wysiwyg) {
            $wysiwyg->initWysiwyg();
        }
    }
    
    public function formatForList($value) {
        $value = strip_tags($value);
        return strlen($value) > 40 ?
                (substr($value, 0, strpos($value, ' ', 40)) . '...') :
                $value;
    }
    
    public function formatForForm($value) {
        return $value;
    }
}